<template>
  <div class="app-container">
    <eHeader :param-bean="paramBean" :sup_this="sup_this" />
    <eForm ref="form" :sup_this="sup_this" />
    <!--表格渲染-->
    <DataGridTable
      v-loading="loading"
      ref="mainTable"
      :sup_this="sup_this"
      :data="data.rtnList"
      :show-page="false"
      :max-height="gridMaxHeight"
      :total="total"
      :all-define-columns="['nextContactTime','followTalk','followFlag','followUserName','lastUpdateDate',]"
      grid-id="followMngProcessGridId"
      @selection-change="handleGridSelectionChange">
      <DataGridColumnSlot prop="followType" label="跟进类型">
        <template slot-scope="scope">
          <edit :data="scope.row" :sup_this="sup_this" />
        </template>
      </DataGridColumnSlot>
      <DataGridColumn slot="followTalk" prop="followTalk" label="猫述" />
      <DataGridColumn slot="followUserName" prop="followUserName" label="跟进用户" />
      <DataGridColumn slot="followFlag" prop="followFlag" label="是否已跟进" />
      <DataGridColumnSlot slot="nextContactTime" prop="nextContactTime" label="下次联系时间" >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.nextContactTime) }}</span>
        </template>
      </DataGridColumnSlot>
      <DataGridColumnSlot slot="lastUpdateDate" prop="lastUpdateDate" label="最后更新时间" >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.lastUpdateDate) }}</span>
        </template>
      </DataGridColumnSlot>
    </DataGridTable>
  </div>
</template>

<script>
import { parseTime } from '@/utils/index'
import eHeader from './module/header'
import edit from './module/edit'
import eForm from './module/form'
import follow from '@/api/crm/Follow'
import initData from '@/mixins/initData'

export default {
  components: { eHeader, eForm, edit },
  mixins: [initData],
  props: {
  },
  data() {
    return {
      delLoading: false,
      sup_this: this,
      busMainData: {}
    }
  },
  created() {
    this.url = follow.loadDataUrl()
    /* this.$nextTick(() => {
      this.resetQuery(true)
    }) */
  },
  mounted() {
  },
  methods: {
    parseTime,
    async beforeInit() {
      return true
    },
    initLoadDataByCode(busMainData) {
      this.busMainData = busMainData
      this.defaultParamBean.objectSysCode = busMainData.sysGenCode
      this.resetQuery(true)
    }
  }
}
</script>
